package com.athena.dal.entities;

import java.io.Serializable;
import javax.persistence.*;

import java.sql.Timestamp;
import java.util.Set;


/**
 * The persistent class for the department database table.
 * 
 */
@Entity
@Table(name="department")
@NamedQuery(name="Department.find", query="SELECT d FROM Department d")
public class Department implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(unique=true, nullable=false, length=2)
	private String id;

	@Column(nullable=false, length=128)
	private String name;

	@Column(nullable=false)
	private Timestamp updatedAt;

	//bi-directional many-to-one association to Faculty
	@ManyToOne
	@JoinColumn(name="hod")
	private Faculty hod;

	//bi-directional many-to-one association to Faculty
	@OneToMany(mappedBy="department")
	private Set<Faculty> faculties;

	public Department() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Timestamp getUpdatedAt() {
		return this.updatedAt;
	}

	public void setUpdatedAt(Timestamp updatedAt) {
		this.updatedAt = updatedAt;
	}

	public Faculty getHod() {
		return this.hod;
	}

	public void setHod(Faculty hod) {
		this.hod = hod;
	}

	public Set<Faculty> getFaculties() {
		return this.faculties;
	}

	public void setFaculties(Set<Faculty> faculties) {
		this.faculties = faculties;
	}

}